Conventionally, the construction of computer programs required the significant and time consuming efforts of a trained computer programmer. Programming by example technologies, on the other hand, allow users to construct and run new programs simply by providing examples of intended behavior. In other words, rather than requiring the user to tell the computer what to do (usually requiring explicit programming), programming by example allows the user to simply show the computer what to do by providing a few examples.
Providing examples of intended behavior is intuitive to a typical human being. After all, humans are familiar with teaching each other how to do something by showing them what to do, and leaving it to the student to apply the demonstrated behavior. Thus, programming by example requires no knowledge of programming languages or special programming techniques. Programming by example thus has the potential to open up new access to flexible computing to a larger population of users who have little or no knowledge of programming.
Programming by example, however, relies on the user to provide examples of behavior. A system evaluates the example behaviors against a vast collection of possible programs with the aim to identifying a program that satisfies the behavior. The identified program is then used to perform the behavior. An example of a behavior might include an input and a corresponding acceptable output. As more and more examples are provided, the system can narrow in on identifying a program that satisfies the demonstrated behavior.
However, the intended behavior could be complex enough that a significant number of examples might be needed in order to determine the intended behavior with sufficient certainty to be able to identify an appropriate program that performs that intended behavior. A typical human being does not want to provide a large number of examples, and/or may not have a large number of examples to provide. Rather, the user often only provides a smaller number of examples, and perhaps even as small as one example.
However, few provided examples are seldom enough to pin down the intended behavior within the vast space of possible programs. Accordingly, the system picks one of the possible programs that has not explicitly been excluded by the example or examples given. Previous approaches to picking a program rely on structure features of the program itself. For instance, there may be a bias towards shorter, simpler, or more naturally structured programs. Whenever the intended behavior is not pinned down by sufficient examples, however, there is a chance that a program will be selected that does not perform the intended behavior will be selected.
The subject matter claimed herein is not limited to embodiments that solve any disadvantages or that operate only in environments such as those described above. Rather, this background is only provided to illustrate one exemplary technology area where some embodiments described herein may be practiced.